<template>
  <div id="app">
    <router-view></router-view>
    <!-- 根据条件显示底部导航栏 -->
    <TabBar v-if="shouldShowTabBar" />
  </div>
</template>

<script>
import TabBar from './components/tabBar.vue';

export default {
  name: 'App',
  components: {
    TabBar
  },
  computed: {
    shouldShowTabBar() {
      // 定义允许显示底部导航栏的路由路径
      const allowedPaths = ['/', '/category', '/cart', '/my'];
      // 判断当前路由路径是否在允许的路径列表中
      return allowedPaths.includes(this.$route.path);
    }
  }
}
</script>

<style></style>